<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>PowerVR SDK</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
<table width="100%">
  <tr>
    <td width="33%">
      <p align="left">&nbsp;<a href="http://www.imgtec.com"><img border="0" src="IMGLogo.jpg" width="200" height="30"></a></p>
    </td>
    <td width="33%">
      <p align="center"><font color="#808080" face="Arial" size="2">PowerVR Software Development Kit</a></font></p>
    </td>
    <td width="34%">
      <p align="right"><a href="http://www.powervr.com"><img border="0" src="PVRlogo.jpg" width="200" height="27"></a></p>
    </td>
  </tr>
</table>
<hr>
</head><body>
<!-- Generated by Doxygen 1.3.6 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div>
<h1>PVRTSingleton.h</h1><a href="PVRTSingleton_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/******************************************************************************</span>
00002 <span class="comment"></span>
00003 <span class="comment"> @File         PVRTSingleton.h</span>
00004 <span class="comment"></span>
00005 <span class="comment"> @Title        PVRTSingleton</span>
00006 <span class="comment"></span>
00007 <span class="comment"> @Version      </span>
00008 <span class="comment"></span>
00009 <span class="comment"> @Copyright    Copyright (C)  Imagination Technologies Limited.</span>
00010 <span class="comment"></span>
00011 <span class="comment"> @Platform     ANSI compatible</span>
00012 <span class="comment"></span>
00013 <span class="comment"> @Description  Singleton template Pattern Usage: Inherit from CPVRTSingleton</span>
00014 <span class="comment">               class like this: class Foo : public CPVRTSingleton&lt;Foo&gt; { ... };</span>
00015 <span class="comment"></span>
00016 <span class="comment">******************************************************************************/</span>
00017 <span class="preprocessor">#ifndef __PVRTSINGLETON__</span>
00018 <span class="preprocessor"></span><span class="preprocessor">#define __PVRTSINGLETON__</span>
00019 <span class="preprocessor"></span>
00020 <span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt; <span class="keyword">class </span><a class="code" href="classCPVRTSingleton.html">CPVRTSingleton</a>
00021 {
00022 <span class="keyword">private</span>:
00023     <a class="code" href="classCPVRTSingleton.html#b0">CPVRTSingleton</a>(<span class="keyword">const</span> <a class="code" href="classCPVRTSingleton.html">CPVRTSingleton</a>&amp;);
<a name="l00024"></a><a class="code" href="classCPVRTSingleton.html">00024</a>     <a class="code" href="classCPVRTSingleton.html">CPVRTSingleton</a> &amp; operator=(<span class="keyword">const</span> <a class="code" href="classCPVRTSingleton.html">CPVRTSingleton</a>&amp;);
00025 
00026 <span class="keyword">public</span>:
00027     <span class="keyword">static</span> T&amp; <a class="code" href="classCPVRTSingleton.html#e0">inst</a>()
00028     {
00029         <span class="keyword">static</span> T object;
00030         <span class="keywordflow">return</span> object;
<a name="l00031"></a><a class="code" href="classCPVRTSingleton.html#e0">00031</a>     }
00032 
00033     <span class="keyword">static</span> T* <a class="code" href="classCPVRTSingleton.html#e1">ptr</a>()
00034     {
00035         <span class="keywordflow">return</span> &amp;<a class="code" href="classCPVRTSingleton.html#e0">inst</a>();
00036     }
<a name="l00037"></a><a class="code" href="classCPVRTSingleton.html#e1">00037</a> 
00038 <span class="keyword">protected</span>:
00039     <a class="code" href="classCPVRTSingleton.html#b0">CPVRTSingleton</a>() {};
00040     <span class="keyword">virtual</span> <a class="code" href="classCPVRTSingleton.html#b1">~CPVRTSingleton</a>() {};
00041 };
00042 
<a name="l00043"></a><a class="code" href="classCPVRTSingleton.html#b0">00043</a> 
<a name="l00044"></a><a class="code" href="classCPVRTSingleton.html#b1">00044</a> <span class="preprocessor">#endif // __PVRTSINGLETON__</span>
00045 <span class="preprocessor"></span>
00046 <span class="comment">/*****************************************************************************</span>
00047 <span class="comment">End of file (PVRTSingleton.h)</span>
00048 <span class="comment">*****************************************************************************/</span>
00049 
</pre></div><br>
<br>
<P align=left><FONT size=2><STRONG><A 
   href="http://www.imgtec.com/powervr/insider/legal/index.asp">Copyright</A> � 
   1999-2008, Imagination Technologies Ltd.</STRONG></FONT></P>
<hr>
<address style="align: left;"><small><FONT color=f0f>
Generated by <a href="http://www.doxygen.org/index.html">DOXYGEN</a> 1.3.6</small></address>
</body>
</html>
